#include "stdafx.h"
#include "build.h"
#include <stdio.h>

#ifndef DATE
#ifdef __DATE__
#define DATE __DATE__
#else
#define DATE "xx/xx/xx"
#endif
#endif

#ifndef TIME
#ifdef __TIME__
#define TIME __TIME__
#else
#define TIME "xx:xx:xx"
#endif
#endif

#ifndef SVNVERSION
#define SVNVERSION "3M"
#endif

/* ------------------------------------------------------------------------*/
#if _MSC_VER >= 1600
#  define VERSIONCOMPILED "msvc 2010"
#elif _MSC_VER >= 1500
#  define VERSIONCOMPILED "msvc 2008"
#elif _MSC_VER >= 1400
#  define VERSIONCOMPILED "msvc 2005"
#elif _MSC_VER >= 1310
#  define VERSIONCOMPILED "msvc 2003"
#elif _MSC_VER > 1300
#  define VERSIONCOMPILED "msvc 2002"
#else
#  define VERSIONCOMPILED "msvc 6.0"
#endif
/* ------------------------------------------------------------------------*/

const char* get_buildinfo()
{
    static char buildinfo[50];
    _snprintf(buildinfo, sizeof(buildinfo),
        "(%.20s, %.9s)[%s]", DATE, TIME, VERSIONCOMPILED);
    return buildinfo;
}

const char* get_svnversion()
{
    /* the following string can be modified by subwcrev.exe */
    static const char svnversion[] = SVNVERSION;
    if (svnversion[0] != '$')
        return svnversion; /* it was interpolated, or passed on command line */
    return "exported";
}